#pragma once

struct l1spirit_config
{
  /* Parallel Imaging Calibration Parameters */

	typedef enum {
		posv,
		chol,
		cheev,
	    lanczos,
		culanczos,
	} spirit_calib_t;

	spirit_calib_t calib_algorithm;

	int *ksize;
	int calib_n_readouts;


	// Parameters for posv/chol

	float calib_tychonov;

	// Parameters for 

	float calib_threshold;
	int calib_pixel_n_eig;
	int calib_pixel_n_qrit;

  /* l1 Minimization Parameters */

	bool l1min_on_gpu;

	float l1_threshold_start, l1_threshold_end;
	int l1spirit_iterations;

  /* Debugging Parameters */

	bool timing_info;
	bool verbose_info;

	enum {
		debug_data,
		debug_density,
		debug_scale,
		debug_wavplan,
		debug_mask,
		debug_calib,
		debug_calib_k3d,
		debug_calib_k2d,
		debug_data_roifft,
		debug_data_soln,
		debug_data_rofft,
		debug_l1s_x0,
		debug_l1s_kern,
		debug_l1s_fft,
		debug_l1s_spir,
		debug_l1s_fwav,
		debug_l1s_lambda,
		debug_l1s_thr,
		debug_l1s_iwav,
		debug_l1s_ifft,
		debug_l1s_proj,

		n_debug_points
	};

	char *debug [n_debug_points];
	int debug_slice;

	l1spirit_config (int ks0 = 7, int ks1 = 7, int ks2 = 7, 
	                 spirit_calib_t calib = chol,
	                 float calib_reg = .02, int calib_nr = 24,
	                 float calib_tau = .02, int pix_eig = 4, int pix_qrit = 4,
	                 bool l1min_gpu = true,
	                 float l1_t0 = .015, float l1_tn = .015, int l1_it = 100);

	~l1spirit_config();

	void print ();
};

void parse_l1spirit_args (l1spirit_config& config, int argc, char *argv[]);

